<style scoped>
    @import '../styles/common.css';
</style>
<template>
    <div style="height:100%;">
        <router-view></router-view>
        <div v-show="loading"  id="loading">
            <div  :class="['spinner',loading?'runSpinner':'']"></div>
        </div>
    </div>
</template>
<script>
    import User from '../module/user';
    import Weixin from '../libs/wxShare';
    import Cart from '../module/cart';
//    import Config from '../config/config'
    import $ from '../libs/zepto'
    export default {
        data () {
            return {
                loading:true
            }
        },
        ready () {

//            if(Weixin.isWeixin) Weixin.init();
            User.init(this.$route.query);
            if(!User.isLogin) window.location.href = Config.apiDomain+'/weixin/siteAuth';
            Cart.init(this.$route.query);
        },
        beforeDestroy () {

        },
        methods: {

        },
        events:{
            isLoading(value){
                console.log(value)
                this.loading=value;
            }
        }
    }
</script>

